package com.hui.blog_server.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 彩色的小灰
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //  设置图片访问路径
        registry.addResourceHandler("/images/**").addResourceLocations("file:public/images/");

        //  设置歌曲访问路径
        registry.addResourceHandler("/audio/**").addResourceLocations("file:public/music/");
    }
}